/**
 * Created by jerry on 2017/11/13.
 *
 */
import request from '@/utils/request'
import {SERVER_URL} from '@/utils/common'
export function getRoleListPage(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+"/role/getRoleListPage",
    method: 'post',
    data:params
  })

}


export function getAllRoles (){
  return request({
    url: SERVER_URL.SYSTEM_SERVER+'/role/getAllRoles',
    method: 'get'
  })

}



export function getUserRoleByUserId(id){

  return request({
    url: SERVER_URL.SYSTEM_SERVER+'/role/getUserRoleByUserId/'+id,
    method: 'get',
  })
}


export function deleteById(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/role/deleteById?id=${params}`,
    method: 'get'
  })
}


export function saveOrUpdate(params){
  return request({
    url: params.id ? SERVER_URL.SYSTEM_SERVER+`/role/update`: SERVER_URL.SYSTEM_SERVER+`/role/save`,
    method: 'post',
    data:params
  })

}



export function assignMenus(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/role/assignMenus`,
    method: 'post',
    data:params
  })
}
